/// <reference path="../Scripts/jquery-1.7.1.min.js" />
/// <reference path="../Scripts/knockout-2.1.0.js" />

jQuery(document).ready(function () {
    var MyLocalPasswordViewModel = new LocalPasswordViewModel();
    ko.applyBindings(MyLocalPasswordViewModel, document.getElementById('ChangePasswordNode'));
    jQuery("#ChangePasswordForm").validate({
        submitHandler: function (form) {
            MyLocalPasswordViewModel.ChangePassword();
            location.href = "/";
        },
        rules: {
            OldPassword: {
                required: true
            },
            NewPassword: {
                required: true,
                minlength: 6,
                maxlength: 50

            },
            ConfirmPassword: {
                equalTo: "#NewPassword"

            }
        },
        messages: {
            ConfirmPassword: {
                equalTo: "This must be the same as the new password field"

            }
        }
    });




});
